import React from "react";
import "./index.less";
import { Button } from "antd";
export default function Title(props) {
  const { title } = props;
  const children = React.Children.toArray(props.children);
  // 具名插槽过滤 ==标题的右边
  const doChildrens = children.filter((item) => item.props.slot == "do");

  // 匿名插槽过滤==放在内容区域
  const defaultChildren = children.filter(
    (item) => item.props.slot == undefined
  );
  return (
    <div className="title">
      {title}
      {doChildrens.map((item) => item)}
      {defaultChildren.map((item) => item)}
      {/* <div className="addgd2">商品分类</div>}
<Button>添加分类</Button> */}
    </div>
  );
}
